package com.lyy.controller;

import com.lyy.entity.Param.StudentParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Liangyaoyun
 */
@RestController
@RequestMapping("/api/v1/student")
public class StudentController {
    @PostMapping("/insert")

    //必须加上@Validated才能有校验器的功能
    public Object insertStudent(@RequestBody  @Validated StudentParam studentParam){
        return "学生添加成功";
    }
}
